package com.example.schoolguider.controller;

import com.example.schoolguider.common.Result;
import com.example.schoolguider.common.ResultStatus;
import com.example.schoolguider.model.User;
import com.example.schoolguider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author wjc
 * @date 2024/6/29 9:59
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/ua/login")
    public Result login(@RequestBody User user) {
        return Result.of(ResultStatus.SUCCESS,userService.login(user));
    }

    @GetMapping("/hello")
    public Result test() {
        return Result.of(ResultStatus.SUCCESS,"hello");
    }
}
